<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>考勤列表</title>
		<link rel="stylesheet" type="text/css" href="../static/common.css"/>
		<link rel="stylesheet" type="text/css" href="static/css/style.css"/>
	</head>
	<body>
		<div class="contant" id="contant" v-cloak>
			<div class="nav clearfix">
				<a href="addattendance.html" class="btnOrange fl">添加考勤</a>
			</div>
			<table class="table day tableHover">
				<thead>
					<tr>
						<th>考勤时间</th>
						<th>考勤人数</th>
						<th>出勤总天数</th>
						<th>平均出勤率</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<tr v-for="val,index in list">
						<td>{{val.year}}</td>
						<td>{{val.peoples}}</td>
						<td>{{val.successDays}}</td>
						<td>{{val.attendance}}</td>
						<td><a :href="'attendance.html?year='+val.year" class="listToDetail">详情</a></td>
					</tr>
				</tbody>
			</table>
			<div class="page1"></div>
		</div>
	</body>
</html>
<script src="../static/js/jquery-1.8.3.js" type="text/javascript" charset="utf-8"></script>
<script src="../static/dx.js" type="text/javascript" charset="utf-8"></script>
<script src="../static/js/vue.js" type="text/javascript" charset="utf-8"></script>
<!-- <script src="../static/js/pages.js" type="text/javascript" charset="utf-8"></script> -->
<script type="text/javascript">
	
	var vm = new Vue({
		el:'#contant',
		mounted:function(){
			this.getData();	
		},
		data:{
			'list':[]
		},
		methods:{
			getData:function(){//获取列表数据
				var $this = this;
				DX.ajax_method({
					'url':'/finance/att/findAttendanceList',
					'callBack':function(res){
						if(res.code == 200){
							console.log(res);
							$this.list = res.data;
							clickTr();//点击变色
						}
					}
				})
			}
		}
	})
	
	function clickTr(){
		setTimeout(function(){
			$('table tbody tr').click(function(){
				DX.clickTr($(this));
			})
		},100)
	}
</script>